#include <iostream>
using namespace std;


//抽象类（接口）  定义规则（只有子类能实现open close 就是一扇门）
class Door
{
public:
	virtual void open() = 0;
	virtual void close() = 0;
	virtual ~Door() {};

private:

};

//旋转门，子类要重写父类所以纯虚函数，只有有一个纯虚函数没重写，子类也是抽象类
class RotateDoor :public Door 
{
	virtual void open() 
	{
		cout << "通过旋转方式开门" << endl;
	};
	virtual void close() 
	{
		cout << "通过旋转方式关门" << endl;

	};
	virtual ~RotateDoor() {};
};

int main()
{
	Door* door = new RotateDoor;
	door->open();
	door->close();
	cout<<"hello"<<endl;
	cout<<"haod"<<endl;
	return 0;
}
